home *** CD-ROM | disk | FTP | other *** search
- property pOrigMember, pDraggingMember, pGlassType, pSpr, pTimer, pIngredient
- global gBarTopManager, gWellSprite
-
- on beginSprite me
- pSpr = sprite(me.spriteNum)
- pOrigMember = pSpr.member
- if pGlassType = #beer then
- pDraggingMember = member("bee_none")
- else
- pDraggingMember = pOrigMember
- end if
- pIngredient = pGlassType
- end
-
- on mDoneDragging me
- global gLastIngredient
- if inBonusMode() then
- dropWellItemInBonusRound(pGlassType)
- gLastIngredient = 0
- exit
- end if
- newBarSlot = placeGlassOnBar(gWellSprite)
- newSlot = newBarSlot[#closest]
- if newSlot > 0 then
- if (newBarSlot[#open] = 1) or (newBarSlot[#empty] = 1) then
- removeBarTopGlass(gBarTopManager, newBarSlot[#closest])
- setBarTopGlass(gBarTopManager, newBarSlot[#closest], pDraggingMember, pGlassType, 0, VOID, #noGarnish)
- soundFX("mGlass_on_bartop", 0, 0)
- else
- if newBarSlot[#status] = #served then
- chillYouveServedDrink()
- else
- remindAboutEmptyButton()
- end if
- end if
- end if
- end
-
- on mouseDown me
- global gWarnedAboutGlassesUnderBar, gGameLevel
- if the doubleClick then
- exit
- end if
- if draggingAnything() then
- replaceDraggingAnything()
- if (pGlassType <> #beer) and ((gGameLevel = 1) or not gWarnedAboutGlassesUnderBar) then
- if voidp(gWarnedAboutGlassesUnderBar) then
- gWarnedAboutGlassesUnderBar = 1
- else
- gWarnedAboutGlassesUnderBar = gWarnedAboutGlassesUnderBar + 1
- end if
- remindToChooseGlass()
- end if
- else
- menuDown = nowTicks()
- clickSound()
- repeat while the stillDown
- if ticksSince(menuDown) > 10 then
- forceToolTip(pSpr, pGlassType, the clickLoc)
- end if
- checkElapsedTime()
- updateStage()
- end repeat
- mPickMeUp()
- end if
- end
-
- on mPickMeUp me
- global gIceSounds
- replaceDraggingAnything()
- returnToBar(VOID, 1)
- if (pGlassType = #beer) and gIceSounds then
- pickupSound = "beer_ice"
- else
- pickupSound = #none
- end if
- sendSprite(gWellSprite, #mDragWellItem, pSpr, pDraggingMember, VOID, pGlassType, pickupSound)
- end
-
- on getPropertyDescriptionList
- return [#pGlassType: [#default: #shot, #comment: "Type of glass:", #format: #symbol, #range: [#shot, #collins, #cocktail, #old_fashioned, #hiball, #shaker, #mixingGlass, #blender, #beer]]]
- end
-
- on mouseEnter me
- if not draggingAnything() then
- pTimer = nowTicks()
- showToolTip(pSpr, pGlassType)
- end if
- end
-
- on mouseLeave me
- if not draggingAnything() then
- hideToolTip()
- end if
- end
-
- on mouseWithin
- if draggingAnything() then
- else
- if tipTickRange(pTimer) then
- forceToolTip(pSpr, pGlassType)
- else
- dismissToolTip()
- end if
- end if
- end
-